﻿/*
 * MyProperty.h
 */

//**************************************************
#undef DECLARE_MY_PROPERTY_BEGIN
#undef DECLARE_MY_PROPERTY_MEMBER
#undef DECLARE_MY_PROPERTY_INIT
#undef DECLARE_MY_PROPERTY_END


//**************************************************
#if defined(IMPLEMENT_MY_PROPERTY_MTBL)

#	define DECLARE_MY_PROPERTY_BEGIN(className, baseClass) \
			IMPLEMENT_RT_CREATOR(className)\
			IMPLEMENT_MTBL_BEGIN(className)\
			IMPLEMENT_MTBL_SUPPER(baseClass)

#	define DECLARE_MY_PROPERTY_MEMBER(type, name) \
			IMPLEMENT_MTBL_MEMBER(name)

#	define DECLARE_MY_PROPERTY_INIT(name, value)

#	define DECLARE_MY_PROPERTY_END() \
			IMPLEMENT_MTBL_END()


//**************************************************
#elif defined(IMPLEMENT_MY_PROPERTY_PROPERTY)

#	define DECLARE_MY_PROPERTY_BEGIN(className, baseClass) \
			REGISTER_PROPERTY_CONVERTER_OBJECT(className)\
			IMPLEMENT_PROPERTY_BEGIN1(className, baseClass)

#	define DECLARE_MY_PROPERTY_MEMBER(type, name) \
			IMPLEMENT_PROPERTY_ATTRIBUTE(name, __TEXT__(#name))

#	define DECLARE_MY_PROPERTY_INIT(name, value)

#	define DECLARE_MY_PROPERTY_END() \
			IMPLEMENT_PROPERTY_END()


//**************************************************
#elif defined(IMPLEMENT_MY_PROPERTY_INIT)

#	define DECLARE_MY_PROPERTY_BEGIN(className, baseClass) \
			className::className(void)\
				: baseClass()

#	define DECLARE_MY_PROPERTY_MEMBER(type, name) 

#	define DECLARE_MY_PROPERTY_INIT(name, value) \
				, name(value)

#	define DECLARE_MY_PROPERTY_END() \
			{}


//**************************************************
#elif defined(IMPLEMENT_MY_PROPERTY_REGISTER)

#	define DECLARE_MY_PROPERTY_BEGIN(className, baseClass) \
			REGISTER_RT_CREATOR(className)\
			REGISTER_PROPERTY(className)

#	define DECLARE_MY_PROPERTY_MEMBER(type, name) 

#	define DECLARE_MY_PROPERTY_INIT(name, value)

#	define DECLARE_MY_PROPERTY_END() 


//**************************************************
#else


	//---------------------------------------------
#	define DECLARE_MY_PROPERTY_BEGIN(className, baseClass) \
			typedef gdk::Unknown::Handle_T<class className> className##Ptr;\
			typedef std::vector<className##Ptr>				className##Array;\
			typedef std::list<className##Ptr>				className##List;\
			class className : public baseClass\
			{\
				DECLARE_CLASS_HANDLE(className)\
				DECLARE_CLASS_INSTANCE(className)\
				DECLARE_CLASS_SERIALIZE(className)\
				DECLARE_RT_CREATOR(className)\
				DECLARE_PROPERTY(className)\
				DECLARE_MTBL(className)\
			protected:\
				className(void);\
			public:

#	define DECLARE_MY_PROPERTY_MEMBER(type, name) \
				type name;

#	define DECLARE_MY_PROPERTY_INIT(name, value)

#	define DECLARE_MY_PROPERTY_END() \
			};


#ifndef __GDK_MY_PROPERTY_H__
#define __GDK_MY_PROPERTY_H__


#include <gdk/core/Types.h>
#include <gdk/core/Mtbl.h>
#include <gdk/core/Property.h>
#include <gdk/core/Exception.h>
#include <gdk/core/Stream.h>



namespace gdk
{




}//namespace gdk



#endif //__GDK_MY_PROPERTY_H__



//**************************************************
#endif
